﻿using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.DTO;
using DXApplicationTangche.UC.款式类别;
using mendian;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.辅料
{
    public partial class Frm款式类别维护 : DevExpress.XtraEditors.XtraForm
    {
        public List<StyleCategoryDTO> styleCategoryDTOs = new List<StyleCategoryDTO>();
        public Frm款式类别维护()
        {
            InitializeComponent();
            this.styleCategoryDTOs = FunctionHelper.JsonDeserialization<List<StyleCategoryDTO>>(RestCall.httpGetMethod(URL.接口url+"/style/getStyleCategoryAll"));
            this.gridControl款式类别.DataSource = this.styleCategoryDTOs;
        }

        private void simpleButton新建_Click(object sender, EventArgs e)
        {
            new Frm款式类别新建().ShowDialog();
            this.gridView款式类别.RefreshData();
        }

        private void gridView款式类别_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            new Frm款式类别预览(FunctionHelper.GetgridViewValue(this.gridView款式类别, e.RowHandle, "code")).ShowDialog();
        }
    }
}
